<?php
App::uses('AppModel', 'Model');
/**
 * CompetitionPost Model
 *
 * @property Competition $Competition
 */
class CompetitionUrl extends AppModel {
/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'id';
/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'url' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'Pole nie może być puste',
				'allowEmpty' => false,
				'required' => true,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'url'=>	array(
				'rule' => array('url', true),
				'message' => 'Proszę dodać poprawny adres url',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			)
		)
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'CompetitionPost' => array(
			'className' => 'CompetitionPost',
			'foreignKey' => 'competition_post_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
}
